package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.PersonAttendanceDao;
import cn.topevery.garden.entity.dto.PersonAttendanceDTO;
import cn.topevery.garden.entity.po.PersonAttendance;
import cn.topevery.garden.entity.po.PersonAttendance;
import cn.topevery.garden.entity.query.PersonAttendanceQuery;
import cn.topevery.garden.entity.vo.PersonAttendanceVO;

import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * 考勤记录
 */
@Service
public class PersonAttendanceLogic extends BaseLogic<PersonAttendance> {
    @Autowired
    PersonAttendanceDao personAttendanceDao;

    @Override
    public BaseEntityDao<PersonAttendance, Integer> getDao() {
        return personAttendanceDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<PersonAttendanceVO> listPage(PersonAttendanceQuery query) {
        return personAttendanceDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        personAttendanceDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param personAttendance 实体
     */
    public void saveOrUpdate(String userId, PersonAttendance personAttendance){
        personAttendanceDao.saveOrUpdate(userId,personAttendance);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public PersonAttendance getEntityByColumn(String key, String value) {
        return personAttendanceDao.getEntityByColumn(key, value);
    }

    public DataPager<PersonAttendanceVO> personAttendanceStat(PersonAttendanceQuery query){
        return personAttendanceDao.personAttendanceStat(query);
    }
}
